home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume9 / xmon / patch2 < prev    next >
Encoding:
Internet Message Format  |  1990-10-11  |  27.9 KB

  1. Path: uunet!jarthur!bridge2!mips!sgi!decwrl!apple!portal!atari!imagen!sun!otc.otca.oz.au
  2. From: gregm@otc.otca.oz.au (Greg McFarlane)
  3. Newsgroups: comp.sources.x
  4. Subject: v09i075: Xmon, Patch2, Part01/01
  5. Message-ID: <143471@sun.Eng.Sun.COM>
  6. Date: 8 Oct 90 17:43:07 GMT
  7. References: <csx-09i075:xmon@uunet.UU.NET>
  8. Sender: news@sun.Eng.Sun.COM
  9. Lines: 1032
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: Greg McFarlane <gregm@otc.otca.oz.au>
  13. Posting-number: Volume 9, Issue 75
  14. Archive-name: xmon/patch2
  15. Patch-To: xmon: Volume 9, Issue 15-19 (9/4/90)
  16. Patch-To: xmon: Volume 9, Issue 30 (9/12/90: patch1)
  17.  
  18. This patch fixes the following problems:
  19.  
  20. 1. Synthetic events (events sent by XSendEvent) are handled correctly.
  21. 2. There was a bug in version 1 when a client exited.
  22. 3. Byte swapping is now handled correctly.
  23.  
  24. ---- Cut Here and unpack ----
  25. #!/bin/sh
  26. # This is xmon, a shell archive (shar 3.32)
  27. # made 10/08/1990 09:03 UTC by gregm@otc.otca.oz.au
  28. # Source directory /u/projects/multi/xmux/xmon
  29. #
  30. # existing files will NOT be overwritten
  31. #
  32. # This shar contains:
  33. # length  mode       name
  34. # ------ ---------- ------------------------------------------
  35. #  25407 -rw-rw-r-- xmon.patch2
  36. #
  37. if touch 2>&1 | fgrep 'amc' > /dev/null
  38.  then TOUCH=touch
  39.  else TOUCH=true
  40. fi
  41. # ============= xmon.patch2 ==============
  42. if test X"$1" != X"-c" -a -f 'xmon.patch2'; then
  43.     echo "File already exists: skipping 'xmon.patch2'"
  44. else
  45. echo "x - extracting xmon.patch2 (Text)"
  46. sed 's/^X//' << 'SHAR_EOF' > xmon.patch2 &&
  47. Xxmon patch 2
  48. X
  49. XThis patch fixes the following problems:
  50. X
  51. X1. Synthetic events (events sent by XSendEvent) are handled correctly.
  52. X2. There was a bug in version 1 when a client exited.
  53. X3. Byte swapping is now handled correctly.
  54. X
  55. XPlus some minor code clean up.
  56. X
  57. XIt makes patches to the following files:
  58. Xpatchlevel.h
  59. Xdecode11.c
  60. Xlinkl.c
  61. Xlinkl.h
  62. Xmain.c
  63. Xprint11.c
  64. Xserver.c
  65. Xtable11.c
  66. X
  67. Xdiff -c version1/patchlevel.h version2/patchlevel.h
  68. X*** version1/patchlevel.h    Mon Sep 10 15:33:48 1990
  69. X--- version2/patchlevel.h    Thu Sep 27 17:03:30 1990
  70. X***************
  71. X*** 1 ****
  72. X! #define PATCHLEVEL 1
  73. X--- 1 ----
  74. X! #define PATCHLEVEL 2
  75. XOnly in version2: Makefile.bak
  76. Xdiff -c version1/decode11.c version2/decode11.c
  77. X*** version1/decode11.c    Mon Sep 10 14:31:16 1990
  78. X--- version2/decode11.c    Thu Sep 27 17:15:50 1990
  79. X***************
  80. X*** 1002,1008 ****
  81. X      long                    n;
  82. X  {
  83. X      int                        fd = server->fdd->fd;
  84. X!     short                    Event = IByte (&buf[0]);
  85. X  
  86. X      if (CountEvents)
  87. X      {
  88. X--- 1002,1008 ----
  89. X      long                    n;
  90. X  {
  91. X      int                        fd = server->fdd->fd;
  92. X!     short                    Event = IByte (&buf[0]) & 0x7f;
  93. X  
  94. X      if (CountEvents)
  95. X      {
  96. Xdiff -c version1/linkl.c version2/linkl.c
  97. X*** version1/linkl.c    Mon Sep 10 14:31:16 1990
  98. X--- version2/linkl.c    Thu Sep 27 17:20:23 1990
  99. X***************
  100. X*** 145,150 ****
  101. X--- 145,158 ----
  102. X  }
  103. X  
  104. X  Global void
  105. X+ deleteList(list)
  106. X+     LinkList  *list;
  107. X+ {
  108. X+     while (!ListIsEmpty(list))
  109. X+         deleteFirst(list);
  110. X+ }
  111. X+ 
  112. X+ Global void
  113. X  freeList(list)
  114. X      LinkList  *list;
  115. X  {
  116. X***************
  117. X*** 157,162 ****
  118. X--- 165,256 ----
  119. X      LinkList  *list;
  120. X  {
  121. X      Tfree(deleteCurrent(list));
  122. X+ }
  123. X+ 
  124. X+ Global Bool
  125. X+ freeMatchingLeaf(list, contents)
  126. X+     LinkList        *list;
  127. X+     Pointer            contents;
  128. X+ {
  129. X+     LinkLeaf        *leaf;
  130. X+ 
  131. X+     for(leaf = list->top; leaf != (LinkLeaf *)list; leaf = leaf->next)
  132. X+         if (leaf->contents == contents)
  133. X+         {
  134. X+             freeLeaf(list, leaf);
  135. X+             return True;
  136. X+         }
  137. X+     return False;
  138. X+ }
  139. X+ 
  140. X+ Global LinkLeaf*
  141. X+ findMatchingLeaf(list, contents)
  142. X+     LinkList        *list;
  143. X+     Pointer            contents;
  144. X+ {
  145. X+     LinkLeaf        *leaf;
  146. X+ 
  147. X+     for(leaf = list->top; leaf != (LinkLeaf *)list; leaf = leaf->next)
  148. X+         if (leaf->contents == contents)
  149. X+             return leaf;
  150. X+     return (LinkLeaf *)NULL;
  151. X+ }
  152. X+ 
  153. X+ Global int
  154. X+ indexOfContents(list, contents)
  155. X+     LinkList        *list;
  156. X+     Pointer            contents;
  157. X+ {
  158. X+     LinkLeaf        *leaf;
  159. X+     int                index = 0;
  160. X+ 
  161. X+     for(leaf = list->top; leaf != (LinkLeaf *)list; leaf = leaf->next, index++)
  162. X+         if (leaf->contents == contents)
  163. X+             return index;
  164. X+     return -1;
  165. X+ }
  166. X+ 
  167. X+ Global Pointer
  168. X+ getIndexedContents(list, index)
  169. X+     LinkList        *list;
  170. X+     int                index;
  171. X+ {
  172. X+     LinkLeaf        *leaf;
  173. X+     int                count = 0;
  174. X+ 
  175. X+     for(leaf = list->top; leaf != (LinkLeaf *)list; leaf = leaf->next, count++)
  176. X+         if (count == index)
  177. X+             return leaf->contents;
  178. X+     return (Pointer)-1;
  179. X+ }
  180. X+ 
  181. X+ Global void
  182. X+ freeLeaf(list, leaf)
  183. X+     LinkList        *list;
  184. X+     LinkLeaf        *leaf;
  185. X+ {
  186. X+     Tfree(deleteLeaf(list, leaf));
  187. X+ }
  188. X+ 
  189. X+ Global Pointer
  190. X+ deleteLeaf(list, leaf)
  191. X+     LinkList        *list;
  192. X+     LinkLeaf        *leaf;
  193. X+ {
  194. X+     Pointer            contents;
  195. X+     
  196. X+     if (leaf == (LinkLeaf *)list)
  197. X+         return ((Pointer)NULL);
  198. X+     else if (leaf == list->current)
  199. X+         return deleteCurrent(list);
  200. X+     else
  201. X+     {
  202. X+         leaf->prev->next = leaf->next;
  203. X+         leaf->next->prev = leaf->prev;
  204. X+         contents = leaf->contents;
  205. X+         Tfree(leaf);
  206. X+         return(contents);
  207. X+     }
  208. X  }
  209. X  
  210. X  static void
  211. Xdiff -c version1/linkl.h version2/linkl.h
  212. X*** version1/linkl.h    Mon Sep 10 14:31:16 1990
  213. X--- version2/linkl.h    Thu Sep 27 17:42:15 1990
  214. X***************
  215. X*** 46,53 ****
  216. X--- 46,60 ----
  217. X  Global Pointer deleteCurrent P((LinkList *list ));
  218. X  Global void AppendToCurrent P((LinkList *list , Pointer contents ));
  219. X  Global void PrependToCurrent P((LinkList *list , Pointer contents ));
  220. X+ Global void deleteList P((LinkList *list ));
  221. X  Global void freeList P((LinkList *list ));
  222. X  Global void freeCurrent P((LinkList *list ));
  223. X+ Global Bool freeMatchingLeaf P((LinkList *list , Pointer contents ));
  224. X+ Global LinkLeaf *findMatchingLeaf P((LinkList *list , Pointer contents ));
  225. X+ Global int indexOfContents P((LinkList *list , Pointer contents ));
  226. X+ Global Pointer getIndexedContents P((LinkList *list , int index ));
  227. X+ Global void freeLeaf P((LinkList *list , LinkLeaf *leaf ));
  228. X+ Global Pointer deleteLeaf P((LinkList *list , LinkLeaf *leaf ));
  229. X  
  230. X  /* end function prototypes */
  231. X  
  232. Xdiff -c version1/main.c version2/main.c
  233. X*** version1/main.c    Mon Sep 10 15:30:57 1990
  234. X--- version2/main.c    Thu Sep 27 17:00:51 1990
  235. X***************
  236. X*** 140,145 ****
  237. X--- 140,155 ----
  238. X          Tfree(server->fdd->inBuffer.data);
  239. X      close(server->fdd->fd);
  240. X      NotUsingFD(server->fdd->fd);
  241. X+     freeList(&client->server_list);
  242. X+     freeMatchingLeaf(&client_list, (Pointer *)client);
  243. X+     debug
  244. X+     (
  245. X+         1,
  246. X+         (
  247. X+             stderr, "CloseConnection: client = %d, server = %d\n",
  248. X+             client->fdd->fd, server->fdd->fd
  249. X+         )
  250. X+     );
  251. X  }
  252. X  
  253. X  static void
  254. X***************
  255. X*** 392,404 ****
  256. X                  }
  257. X              }
  258. X          }
  259. X!         ForAllInList(&client_list)
  260. X          {
  261. X              client = (Client *)CurrentContentsOfList(&client_list);
  262. X-             if (!SendBuffer(client->fdd->fd, &client->fdd->outBuffer))
  263. X-                 CloseConnection(client);
  264. X              server = (Server *)(TopOfList(&client->server_list));
  265. X!             if (!SendBuffer(server->fdd->fd, &server->fdd->outBuffer))
  266. X                  CloseConnection(client);
  267. X          }
  268. X      }
  269. X--- 402,420 ----
  270. X                  }
  271. X              }
  272. X          }
  273. X!         client_list.current = client_list.top;
  274. X!         while (client_list.current != (LinkLeaf *)(&client_list))
  275. X          {
  276. X              client = (Client *)CurrentContentsOfList(&client_list);
  277. X              server = (Server *)(TopOfList(&client->server_list));
  278. X!             if
  279. X!             (
  280. X!                 SendBuffer(client->fdd->fd, &client->fdd->outBuffer)
  281. X!                 &&
  282. X!                 SendBuffer(server->fdd->fd, &server->fdd->outBuffer)
  283. X!             )
  284. X!                 client_list.current = client_list.current->next;
  285. X!             else
  286. X                  CloseConnection(client);
  287. X          }
  288. X      }
  289. X***************
  290. X*** 1082,1088 ****
  291. X  #if (mskcnt>4)
  292. X  static Bool
  293. X  ANYSET(src)
  294. X! long src[];
  295. X  {
  296. X      int cri;
  297. X  
  298. X--- 1098,1104 ----
  299. X  #if (mskcnt>4)
  300. X  static Bool
  301. X  ANYSET(src)
  302. X! long *src;
  303. X  {
  304. X      int cri;
  305. X  
  306. Xdiff -c version1/print11.c version2/print11.c
  307. X*** version1/print11.c    Mon Sep 10 14:31:17 1990
  308. X--- version2/print11.c    Mon Oct  8 18:28:53 1990
  309. X***************
  310. X*** 46,51 ****
  311. X--- 46,52 ----
  312. X  
  313. X  static char *REQUESTHEADER = "............REQUEST";
  314. X  static char *EVENTHEADER = "..............EVENT";
  315. X+ static char *SYNTHETIC_EVENTHEADER = "....SYNTHETIC EVENT";
  316. X  static char *ERRORHEADER = "..............ERROR";
  317. X  static char *REPLYHEADER = "..............REPLY";
  318. X  
  319. X***************
  320. X*** 307,317 ****
  321. X   * Event Printing procedures
  322. X   */
  323. X  
  324. X  Global void
  325. X  KeyPressEvent(buf)
  326. X          unsigned char *buf;
  327. X  {
  328. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyPress */ ;
  329. X      if (CurrentVerbose < 2)
  330. X          return;
  331. X      PrintField(buf, 1, 1, KEYCODE, "detail");
  332. X--- 308,328 ----
  333. X   * Event Printing procedures
  334. X   */
  335. X  
  336. X+ static void
  337. X+ PrintEventName(buf)
  338. X+         unsigned char *buf;
  339. X+ {
  340. X+     if (IByte(&buf[0]) & 0x80)
  341. X+         PrintField(buf, 0, 1, EVENT, SYNTHETIC_EVENTHEADER);
  342. X+     else
  343. X+         PrintField(buf, 0, 1, EVENT, EVENTHEADER);
  344. X+ }
  345. X+ 
  346. X  Global void
  347. X  KeyPressEvent(buf)
  348. X          unsigned char *buf;
  349. X  {
  350. X!     PrintEventName(buf) /* KeyPress */ ;
  351. X      if (CurrentVerbose < 2)
  352. X          return;
  353. X      PrintField(buf, 1, 1, KEYCODE, "detail");
  354. X***************
  355. X*** 332,338 ****
  356. X  KeyReleaseEvent(buf)
  357. X          unsigned char *buf;
  358. X  {
  359. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyRelease */ ;
  360. X      if (CurrentVerbose < 2)
  361. X          return;
  362. X      PrintField(buf, 1, 1, KEYCODE, "detail");
  363. X--- 343,349 ----
  364. X  KeyReleaseEvent(buf)
  365. X          unsigned char *buf;
  366. X  {
  367. X!     PrintEventName(buf) /* KeyRelease */ ;
  368. X      if (CurrentVerbose < 2)
  369. X          return;
  370. X      PrintField(buf, 1, 1, KEYCODE, "detail");
  371. X***************
  372. X*** 353,359 ****
  373. X  ButtonPressEvent(buf)
  374. X          unsigned char *buf;
  375. X  {
  376. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonPress */ ;
  377. X      if (CurrentVerbose < 2)
  378. X          return;
  379. X      PrintField(buf, 1, 1, BUTTON, "detail");
  380. X--- 364,370 ----
  381. X  ButtonPressEvent(buf)
  382. X          unsigned char *buf;
  383. X  {
  384. X!     PrintEventName(buf) /* ButtonPress */ ;
  385. X      if (CurrentVerbose < 2)
  386. X          return;
  387. X      PrintField(buf, 1, 1, BUTTON, "detail");
  388. X***************
  389. X*** 374,380 ****
  390. X  ButtonReleaseEvent(buf)
  391. X          unsigned char *buf;
  392. X  {
  393. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonRelease */ ;
  394. X      if (CurrentVerbose < 2)
  395. X          return;
  396. X      PrintField(buf, 1, 1, BUTTON, "detail");
  397. X--- 385,391 ----
  398. X  ButtonReleaseEvent(buf)
  399. X          unsigned char *buf;
  400. X  {
  401. X!     PrintEventName(buf) /* ButtonRelease */ ;
  402. X      if (CurrentVerbose < 2)
  403. X          return;
  404. X      PrintField(buf, 1, 1, BUTTON, "detail");
  405. X***************
  406. X*** 395,401 ****
  407. X  MotionNotifyEvent(buf)
  408. X          unsigned char *buf;
  409. X  {
  410. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MotionNotify */ ;
  411. X      if (CurrentVerbose < 2)
  412. X          return;
  413. X      PrintField(buf, 1, 1, MOTIONDETAIL, "detail");
  414. X--- 406,412 ----
  415. X  MotionNotifyEvent(buf)
  416. X          unsigned char *buf;
  417. X  {
  418. X!     PrintEventName(buf) /* MotionNotify */ ;
  419. X      if (CurrentVerbose < 2)
  420. X          return;
  421. X      PrintField(buf, 1, 1, MOTIONDETAIL, "detail");
  422. X***************
  423. X*** 416,422 ****
  424. X  EnterNotifyEvent(buf)
  425. X          unsigned char *buf;
  426. X  {
  427. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* EnterNotify */ ;
  428. X      if (CurrentVerbose < 2)
  429. X          return;
  430. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  431. X--- 427,433 ----
  432. X  EnterNotifyEvent(buf)
  433. X          unsigned char *buf;
  434. X  {
  435. X!     PrintEventName(buf) /* EnterNotify */ ;
  436. X      if (CurrentVerbose < 2)
  437. X          return;
  438. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  439. X***************
  440. X*** 438,444 ****
  441. X  LeaveNotifyEvent(buf)
  442. X          unsigned char *buf;
  443. X  {
  444. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* LeaveNotify */ ;
  445. X      if (CurrentVerbose < 2)
  446. X          return;
  447. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  448. X--- 449,455 ----
  449. X  LeaveNotifyEvent(buf)
  450. X          unsigned char *buf;
  451. X  {
  452. X!     PrintEventName(buf) /* LeaveNotify */ ;
  453. X      if (CurrentVerbose < 2)
  454. X          return;
  455. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  456. X***************
  457. X*** 460,466 ****
  458. X  FocusInEvent(buf)
  459. X          unsigned char *buf;
  460. X  {
  461. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusIn */ ;
  462. X      if (CurrentVerbose < 2)
  463. X          return;
  464. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  465. X--- 471,477 ----
  466. X  FocusInEvent(buf)
  467. X          unsigned char *buf;
  468. X  {
  469. X!     PrintEventName(buf) /* FocusIn */ ;
  470. X      if (CurrentVerbose < 2)
  471. X          return;
  472. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  473. X***************
  474. X*** 473,479 ****
  475. X  FocusOutEvent(buf)
  476. X          unsigned char *buf;
  477. X  {
  478. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusOut */ ;
  479. X      if (CurrentVerbose < 2)
  480. X          return;
  481. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  482. X--- 484,490 ----
  483. X  FocusOutEvent(buf)
  484. X          unsigned char *buf;
  485. X  {
  486. X!     PrintEventName(buf) /* FocusOut */ ;
  487. X      if (CurrentVerbose < 2)
  488. X          return;
  489. X      PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  490. X***************
  491. X*** 486,492 ****
  492. X  KeymapNotifyEvent(buf)
  493. X          unsigned char *buf;
  494. X  {
  495. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeymapNotify */ ;
  496. X      if (CurrentVerbose < 2)
  497. X          return;
  498. X      PrintBytes(&buf[1], (long)31,"keys");
  499. X--- 497,503 ----
  500. X  KeymapNotifyEvent(buf)
  501. X          unsigned char *buf;
  502. X  {
  503. X!     PrintEventName(buf) /* KeymapNotify */ ;
  504. X      if (CurrentVerbose < 2)
  505. X          return;
  506. X      PrintBytes(&buf[1], (long)31,"keys");
  507. X***************
  508. X*** 496,502 ****
  509. X  ExposeEvent(buf)
  510. X          unsigned char *buf;
  511. X  {
  512. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* Expose */ ;
  513. X      if (CurrentVerbose < 2)
  514. X          return;
  515. X      printfield(buf, 2, 2, CARD16, "sequence number");
  516. X--- 507,513 ----
  517. X  ExposeEvent(buf)
  518. X          unsigned char *buf;
  519. X  {
  520. X!     PrintEventName(buf) /* Expose */ ;
  521. X      if (CurrentVerbose < 2)
  522. X          return;
  523. X      printfield(buf, 2, 2, CARD16, "sequence number");
  524. X***************
  525. X*** 512,518 ****
  526. X  GraphicsExposureEvent(buf)
  527. X          unsigned char *buf;
  528. X  {
  529. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GraphicsExposure */ ;
  530. X      if (CurrentVerbose < 2)
  531. X          return;
  532. X      printfield(buf, 2, 2, CARD16, "sequence number");
  533. X--- 523,529 ----
  534. X  GraphicsExposureEvent(buf)
  535. X          unsigned char *buf;
  536. X  {
  537. X!     PrintEventName(buf) /* GraphicsExposure */ ;
  538. X      if (CurrentVerbose < 2)
  539. X          return;
  540. X      printfield(buf, 2, 2, CARD16, "sequence number");
  541. X***************
  542. X*** 530,536 ****
  543. X  NoExposureEvent(buf)
  544. X          unsigned char *buf;
  545. X  {
  546. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* NoExposure */ ;
  547. X      if (CurrentVerbose < 2)
  548. X          return;
  549. X      printfield(buf, 2, 2, CARD16, "sequence number");
  550. X--- 541,547 ----
  551. X  NoExposureEvent(buf)
  552. X          unsigned char *buf;
  553. X  {
  554. X!     PrintEventName(buf) /* NoExposure */ ;
  555. X      if (CurrentVerbose < 2)
  556. X          return;
  557. X      printfield(buf, 2, 2, CARD16, "sequence number");
  558. X***************
  559. X*** 543,549 ****
  560. X  VisibilityNotifyEvent(buf)
  561. X          unsigned char *buf;
  562. X  {
  563. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* VisibilityNotify */ ;
  564. X      if (CurrentVerbose < 2)
  565. X          return;
  566. X      printfield(buf, 2, 2, CARD16, "sequence number");
  567. X--- 554,560 ----
  568. X  VisibilityNotifyEvent(buf)
  569. X          unsigned char *buf;
  570. X  {
  571. X!     PrintEventName(buf) /* VisibilityNotify */ ;
  572. X      if (CurrentVerbose < 2)
  573. X          return;
  574. X      printfield(buf, 2, 2, CARD16, "sequence number");
  575. X***************
  576. X*** 555,561 ****
  577. X  CreateNotifyEvent(buf)
  578. X          unsigned char *buf;
  579. X  {
  580. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CreateNotify */ ;
  581. X      if (CurrentVerbose < 2)
  582. X          return;
  583. X      printfield(buf, 2, 2, CARD16, "sequence number");
  584. X--- 566,572 ----
  585. X  CreateNotifyEvent(buf)
  586. X          unsigned char *buf;
  587. X  {
  588. X!     PrintEventName(buf) /* CreateNotify */ ;
  589. X      if (CurrentVerbose < 2)
  590. X          return;
  591. X      printfield(buf, 2, 2, CARD16, "sequence number");
  592. X***************
  593. X*** 573,579 ****
  594. X  DestroyNotifyEvent(buf)
  595. X          unsigned char *buf;
  596. X  {
  597. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* DestroyNotify */ ;
  598. X      if (CurrentVerbose < 2)
  599. X          return;
  600. X      printfield(buf, 2, 2, CARD16, "sequence number");
  601. X--- 584,590 ----
  602. X  DestroyNotifyEvent(buf)
  603. X          unsigned char *buf;
  604. X  {
  605. X!     PrintEventName(buf) /* DestroyNotify */ ;
  606. X      if (CurrentVerbose < 2)
  607. X          return;
  608. X      printfield(buf, 2, 2, CARD16, "sequence number");
  609. X***************
  610. X*** 585,591 ****
  611. X  UnmapNotifyEvent(buf)
  612. X          unsigned char *buf;
  613. X  {
  614. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* UnmapNotify */ ;
  615. X      if (CurrentVerbose < 2)
  616. X          return;
  617. X      printfield(buf, 2, 2, CARD16, "sequence number");
  618. X--- 596,602 ----
  619. X  UnmapNotifyEvent(buf)
  620. X          unsigned char *buf;
  621. X  {
  622. X!     PrintEventName(buf) /* UnmapNotify */ ;
  623. X      if (CurrentVerbose < 2)
  624. X          return;
  625. X      printfield(buf, 2, 2, CARD16, "sequence number");
  626. X***************
  627. X*** 598,604 ****
  628. X  MapNotifyEvent(buf)
  629. X          unsigned char *buf;
  630. X  {
  631. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MapNotify */ ;
  632. X      if (CurrentVerbose < 2)
  633. X          return;
  634. X      printfield(buf, 2, 2, CARD16, "sequence number");
  635. X--- 609,615 ----
  636. X  MapNotifyEvent(buf)
  637. X          unsigned char *buf;
  638. X  {
  639. X!     PrintEventName(buf) /* MapNotify */ ;
  640. X      if (CurrentVerbose < 2)
  641. X          return;
  642. X      printfield(buf, 2, 2, CARD16, "sequence number");
  643. X***************
  644. X*** 611,617 ****
  645. X  MapRequestEvent(buf)
  646. X          unsigned char *buf;
  647. X  {
  648. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MapRequest */ ;
  649. X      if (CurrentVerbose < 2)
  650. X          return;
  651. X      printfield(buf, 2, 2, CARD16, "sequence number");
  652. X--- 622,628 ----
  653. X  MapRequestEvent(buf)
  654. X          unsigned char *buf;
  655. X  {
  656. X!     PrintEventName(buf) /* MapRequest */ ;
  657. X      if (CurrentVerbose < 2)
  658. X          return;
  659. X      printfield(buf, 2, 2, CARD16, "sequence number");
  660. X***************
  661. X*** 623,629 ****
  662. X  ReparentNotifyEvent(buf)
  663. X          unsigned char *buf;
  664. X  {
  665. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ReparentNotify */ ;
  666. X      if (CurrentVerbose < 2)
  667. X          return;
  668. X      printfield(buf, 2, 2, CARD16, "sequence number");
  669. X--- 634,640 ----
  670. X  ReparentNotifyEvent(buf)
  671. X          unsigned char *buf;
  672. X  {
  673. X!     PrintEventName(buf) /* ReparentNotify */ ;
  674. X      if (CurrentVerbose < 2)
  675. X          return;
  676. X      printfield(buf, 2, 2, CARD16, "sequence number");
  677. X***************
  678. X*** 639,645 ****
  679. X  ConfigureNotifyEvent(buf)
  680. X          unsigned char *buf;
  681. X  {
  682. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ConfigureNotify */ ;
  683. X      if (CurrentVerbose < 2)
  684. X          return;
  685. X      printfield(buf, 2, 2, CARD16, "sequence number");
  686. X--- 650,656 ----
  687. X  ConfigureNotifyEvent(buf)
  688. X          unsigned char *buf;
  689. X  {
  690. X!     PrintEventName(buf) /* ConfigureNotify */ ;
  691. X      if (CurrentVerbose < 2)
  692. X          return;
  693. X      printfield(buf, 2, 2, CARD16, "sequence number");
  694. X***************
  695. X*** 658,664 ****
  696. X  ConfigureRequestEvent(buf)
  697. X          unsigned char *buf;
  698. X  {
  699. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ConfigureRequest */ ;
  700. X      if (CurrentVerbose < 2)
  701. X          return;
  702. X      PrintField(buf, 1, 1, STACKMODE, "stack-mode");
  703. X--- 669,675 ----
  704. X  ConfigureRequestEvent(buf)
  705. X          unsigned char *buf;
  706. X  {
  707. X!     PrintEventName(buf) /* ConfigureRequest */ ;
  708. X      if (CurrentVerbose < 2)
  709. X          return;
  710. X      PrintField(buf, 1, 1, STACKMODE, "stack-mode");
  711. X***************
  712. X*** 678,684 ****
  713. X  GravityNotifyEvent(buf)
  714. X          unsigned char *buf;
  715. X  {
  716. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GravityNotify */ ;
  717. X      if (CurrentVerbose < 2)
  718. X          return;
  719. X      printfield(buf, 2, 2, CARD16, "sequence number");
  720. X--- 689,695 ----
  721. X  GravityNotifyEvent(buf)
  722. X          unsigned char *buf;
  723. X  {
  724. X!     PrintEventName(buf) /* GravityNotify */ ;
  725. X      if (CurrentVerbose < 2)
  726. X          return;
  727. X      printfield(buf, 2, 2, CARD16, "sequence number");
  728. X***************
  729. X*** 692,698 ****
  730. X  ResizeRequestEvent(buf)
  731. X          unsigned char *buf;
  732. X  {
  733. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ResizeRequest */ ;
  734. X      if (CurrentVerbose < 2)
  735. X          return;
  736. X      printfield(buf, 2, 2, CARD16, "sequence number");
  737. X--- 703,709 ----
  738. X  ResizeRequestEvent(buf)
  739. X          unsigned char *buf;
  740. X  {
  741. X!     PrintEventName(buf) /* ResizeRequest */ ;
  742. X      if (CurrentVerbose < 2)
  743. X          return;
  744. X      printfield(buf, 2, 2, CARD16, "sequence number");
  745. X***************
  746. X*** 705,711 ****
  747. X  CirculateNotifyEvent(buf)
  748. X          unsigned char *buf;
  749. X  {
  750. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CirculateNotify */ ;
  751. X      if (CurrentVerbose < 2)
  752. X          return;
  753. X      printfield(buf, 2, 2, CARD16, "sequence number");
  754. X--- 716,722 ----
  755. X  CirculateNotifyEvent(buf)
  756. X          unsigned char *buf;
  757. X  {
  758. X!     PrintEventName(buf) /* CirculateNotify */ ;
  759. X      if (CurrentVerbose < 2)
  760. X          return;
  761. X      printfield(buf, 2, 2, CARD16, "sequence number");
  762. X***************
  763. X*** 719,725 ****
  764. X  CirculateRequestEvent(buf)
  765. X          unsigned char *buf;
  766. X  {
  767. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CirculateRequest */ ;
  768. X      if (CurrentVerbose < 2)
  769. X          return;
  770. X      printfield(buf, 2, 2, CARD16, "sequence number");
  771. X--- 730,736 ----
  772. X  CirculateRequestEvent(buf)
  773. X          unsigned char *buf;
  774. X  {
  775. X!     PrintEventName(buf) /* CirculateRequest */ ;
  776. X      if (CurrentVerbose < 2)
  777. X          return;
  778. X      printfield(buf, 2, 2, CARD16, "sequence number");
  779. X***************
  780. X*** 732,738 ****
  781. X  PropertyNotifyEvent(buf)
  782. X          unsigned char *buf;
  783. X  {
  784. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* PropertyNotify */ ;
  785. X      if (CurrentVerbose < 2)
  786. X          return;
  787. X      printfield(buf, 2, 2, CARD16, "sequence number");
  788. X--- 743,749 ----
  789. X  PropertyNotifyEvent(buf)
  790. X          unsigned char *buf;
  791. X  {
  792. X!     PrintEventName(buf) /* PropertyNotify */ ;
  793. X      if (CurrentVerbose < 2)
  794. X          return;
  795. X      printfield(buf, 2, 2, CARD16, "sequence number");
  796. X***************
  797. X*** 746,752 ****
  798. X  SelectionClearEvent(buf)
  799. X          unsigned char *buf;
  800. X  {
  801. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* SelectionClear */ ;
  802. X      if (CurrentVerbose < 2)
  803. X          return;
  804. X      printfield(buf, 2, 2, CARD16, "sequence number");
  805. X--- 757,763 ----
  806. X  SelectionClearEvent(buf)
  807. X          unsigned char *buf;
  808. X  {
  809. X!     PrintEventName(buf) /* SelectionClear */ ;
  810. X      if (CurrentVerbose < 2)
  811. X          return;
  812. X      printfield(buf, 2, 2, CARD16, "sequence number");
  813. X***************
  814. X*** 759,765 ****
  815. X  SelectionRequestEvent(buf)
  816. X          unsigned char *buf;
  817. X  {
  818. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* SelectionRequest */ ;
  819. X      if (CurrentVerbose < 2)
  820. X          return;
  821. X      printfield(buf, 2, 2, CARD16, "sequence number");
  822. X--- 770,776 ----
  823. X  SelectionRequestEvent(buf)
  824. X          unsigned char *buf;
  825. X  {
  826. X!     PrintEventName(buf) /* SelectionRequest */ ;
  827. X      if (CurrentVerbose < 2)
  828. X          return;
  829. X      printfield(buf, 2, 2, CARD16, "sequence number");
  830. X***************
  831. X*** 775,781 ****
  832. X  SelectionNotifyEvent(buf)
  833. X          unsigned char *buf;
  834. X  {
  835. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* SelectionNotify */ ;
  836. X      if (CurrentVerbose < 2)
  837. X          return;
  838. X      printfield(buf, 2, 2, CARD16, "sequence number");
  839. X--- 786,792 ----
  840. X  SelectionNotifyEvent(buf)
  841. X          unsigned char *buf;
  842. X  {
  843. X!     PrintEventName(buf) /* SelectionNotify */ ;
  844. X      if (CurrentVerbose < 2)
  845. X          return;
  846. X      printfield(buf, 2, 2, CARD16, "sequence number");
  847. X***************
  848. X*** 790,796 ****
  849. X  ColormapNotifyEvent(buf)
  850. X          unsigned char *buf;
  851. X  {
  852. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ColormapNotify */ ;
  853. X      if (CurrentVerbose < 2)
  854. X          return;
  855. X      printfield(buf, 2, 2, CARD16, "sequence number");
  856. X--- 801,807 ----
  857. X  ColormapNotifyEvent(buf)
  858. X          unsigned char *buf;
  859. X  {
  860. X!     PrintEventName(buf) /* ColormapNotify */ ;
  861. X      if (CurrentVerbose < 2)
  862. X          return;
  863. X      printfield(buf, 2, 2, CARD16, "sequence number");
  864. X***************
  865. X*** 804,810 ****
  866. X  ClientMessageEvent(buf)
  867. X          unsigned char *buf;
  868. X  {
  869. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ClientMessage */ ;
  870. X      if (CurrentVerbose < 2)
  871. X          return;
  872. X      PrintField(buf, 1, 1, CARD8, "format");
  873. X--- 815,821 ----
  874. X  ClientMessageEvent(buf)
  875. X          unsigned char *buf;
  876. X  {
  877. X!     PrintEventName(buf) /* ClientMessage */ ;
  878. X      if (CurrentVerbose < 2)
  879. X          return;
  880. X      PrintField(buf, 1, 1, CARD8, "format");
  881. X***************
  882. X*** 818,824 ****
  883. X  MappingNotifyEvent(buf)
  884. X          unsigned char *buf;
  885. X  {
  886. X!     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MappingNotify */ ;
  887. X      if (CurrentVerbose < 2)
  888. X          return;
  889. X      printfield(buf, 2, 2, CARD16, "sequence number");
  890. X--- 829,835 ----
  891. X  MappingNotifyEvent(buf)
  892. X          unsigned char *buf;
  893. X  {
  894. X!     PrintEventName(buf) /* MappingNotify */ ;
  895. X      if (CurrentVerbose < 2)
  896. X          return;
  897. X      printfield(buf, 2, 2, CARD16, "sequence number");
  898. Xdiff -c version1/server.c version2/server.c
  899. X*** version1/server.c    Mon Sep 10 14:31:17 1990
  900. X--- version2/server.c    Thu Sep 27 17:36:46 1990
  901. X***************
  902. X*** 31,38 ****
  903. X  /* server.c: */
  904. X  static void ProcessBuffer P((int fd , unsigned char *buf , long n , int
  905. X  WriteFD ));
  906. X- static void WriteBuffer P((Client *client , long n , char *buf , int
  907. X- WriteFD ));
  908. X  static long StartSetUpMessage P((Pointer private_data , unsigned char
  909. X  *buf , long n ));
  910. X  static long FinishSetUpMessage P((Pointer private_data , unsigned char
  911. X--- 31,36 ----
  912. X***************
  913. X*** 189,225 ****
  914. X      server->fdd->inBuffer.num_Needed = 8;
  915. X  }
  916. X  
  917. X- static void
  918. X- WriteBuffer(client, n, buf, WriteFD)
  919. X-     Client                    *client;
  920. X-     long                    n;
  921. X-     char                    *buf;
  922. X-     int                        WriteFD;
  923. X- {
  924. X-     int                        BytesToWrite = n;
  925. X-     int                        num_written;
  926. X- 
  927. X-     while (BytesToWrite > 0)
  928. X-     {
  929. X-         num_written = write (WriteFD, buf, BytesToWrite);
  930. X-         if (num_written > 0)
  931. X-         {
  932. X-             BytesToWrite -= num_written;
  933. X-             buf += num_written;
  934. X-         }
  935. X-         else
  936. X-         {
  937. X-             if (errno == EWOULDBLOCK)
  938. X-                 printf("WriteBuffer: write would block (TODO)\n");
  939. X-             if (errno == EINTR)
  940. X-                 printf("WriteBuffer: write interrupted (TODO)\n");
  941. X-             perror("Error on write to Client/Server");
  942. X-             CloseConnection(client);
  943. X-             BytesToWrite = 0;
  944. X-         }
  945. X-     }
  946. X- }
  947. X- 
  948. X  /*
  949. X   * StartSetUpMessage:
  950. X   *
  951. X--- 187,192 ----
  952. X***************
  953. X*** 238,243 ****
  954. X--- 205,214 ----
  955. X      short                    namelength;
  956. X      short                    datalength;
  957. X  
  958. X+     littleEndian = client->fdd->littleEndian = (buf[0] == 'l');
  959. X+     ((Server *)(TopOfList(&client->server_list)))->fdd->littleEndian
  960. X+         = littleEndian;
  961. X+ 
  962. X      namelength = IShort(&buf[6]);
  963. X      datalength = IShort(&buf[8]);
  964. X      client->fdd->ByteProcessing = FinishSetUpMessage;
  965. X***************
  966. X*** 253,260 ****
  967. X      long                    n;
  968. X  {
  969. X      Client                    *client = (Client *) private_data;
  970. X- 
  971. X-     littleEndian = client->fdd->littleEndian = (buf[0] == 'l');
  972. X  
  973. X      CurrentVerbose = ErrorVerbose;
  974. X      PrintSetUpMessage(buf);
  975. X--- 224,229 ----
  976. Xdiff -c version1/table11.c version2/table11.c
  977. X*** version1/table11.c    Mon Sep 10 14:31:18 1990
  978. X--- version2/table11.c    Mon Oct  8 18:29:18 1990
  979. X***************
  980. X*** 428,433 ****
  981. X--- 428,466 ----
  982. X      DefineEValue(p, 33L, "ClientMessage");
  983. X      DefineEValue(p, 34L, "MappingNotify");
  984. X  
  985. X+     DefineEValue(p, 128L + 2L, "KeyPress");
  986. X+     DefineEValue(p, 128L + 3L, "KeyRelease");
  987. X+     DefineEValue(p, 128L + 4L, "ButtonPress");
  988. X+     DefineEValue(p, 128L + 5L, "ButtonRelease");
  989. X+     DefineEValue(p, 128L + 6L, "MotionNotify");
  990. X+     DefineEValue(p, 128L + 7L, "EnterNotify");
  991. X+     DefineEValue(p, 128L + 8L, "LeaveNotify");
  992. X+     DefineEValue(p, 128L + 9L, "FocusIn");
  993. X+     DefineEValue(p, 128L + 10L, "FocusOut");
  994. X+     DefineEValue(p, 128L + 11L, "KeymapNotify");
  995. X+     DefineEValue(p, 128L + 12L, "Expose");
  996. X+     DefineEValue(p, 128L + 13L, "GraphicsExposure");
  997. X+     DefineEValue(p, 128L + 14L, "NoExposure");
  998. X+     DefineEValue(p, 128L + 15L, "VisibilityNotify");
  999. X+     DefineEValue(p, 128L + 16L, "CreateNotify");
  1000. X+     DefineEValue(p, 128L + 17L, "DestroyNotify");
  1001. X+     DefineEValue(p, 128L + 18L, "UnmapNotify");
  1002. X+     DefineEValue(p, 128L + 19L, "MapNotify");
  1003. X+     DefineEValue(p, 128L + 20L, "MapRequest");
  1004. X+     DefineEValue(p, 128L + 21L, "ReparentNotify");
  1005. X+     DefineEValue(p, 128L + 22L, "ConfigureNotify");
  1006. X+     DefineEValue(p, 128L + 23L, "ConfigureRequest");
  1007. X+     DefineEValue(p, 128L + 24L, "GravityNotify");
  1008. X+     DefineEValue(p, 128L + 25L, "ResizeRequest");
  1009. X+     DefineEValue(p, 128L + 26L, "CirculateNotify");
  1010. X+     DefineEValue(p, 128L + 27L, "CirculateRequest");
  1011. X+     DefineEValue(p, 128L + 28L, "PropertyNotify");
  1012. X+     DefineEValue(p, 128L + 29L, "SelectionClear");
  1013. X+     DefineEValue(p, 128L + 30L, "SelectionRequest");
  1014. X+     DefineEValue(p, 128L + 31L, "SelectionNotify");
  1015. X+     DefineEValue(p, 128L + 32L, "ColormapNotify");
  1016. X+     DefineEValue(p, 128L + 33L, "ClientMessage");
  1017. X+     DefineEValue(p, 128L + 34L, "MappingNotify");
  1018. X  
  1019. X      p = DefineType(BITGRAVITY, ENUMERATED, "BITGRAVITY", PrintENUMERATED);
  1020. X      DefineEValue(p, 0L, "Forget");
  1021. SHAR_EOF
  1022. $TOUCH -am 1008190090 xmon.patch2 &&
  1023. chmod 0664 xmon.patch2 ||
  1024. echo "restore of xmon.patch2 failed"
  1025. set `wc -c xmon.patch2`;Wc_c=$1
  1026. if test "$Wc_c" != "25407"; then
  1027.     echo original size 25407, current size $Wc_c
  1028. fi
  1029. fi
  1030. exit 0
  1031.  
  1032.                     Greg McFarlane
  1033.                     |||| OTC ||
  1034.  
  1035.                 ACSnet:  gregm@otc.otca.oz.au
  1036.                   UUCP:  {uunet,mcvax}!otc.otca.oz.au!gregm
  1037.                  Snail:  GPO Box 7000, Sydney 2001, Australia
  1038.                  Phone:  +61 2 287 3139    Fax: +61 2 287 3299
  1039.  
  1040. dan
  1041. ----------------------------------------------------
  1042. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1043. Opinions expressed reflect those of the author only.
  1044.